package com.yezi.lampcourt.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by HongMing Ye
 * on 2017/9/19 0019.
 */

public abstract class BaseActivity<P extends BasePresenter> extends AppCompatActivity {
    protected P mPresenter;
    protected LoadingDialog mLoadingDialog;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    public void showLoading() {
        mLoadingDialog = new LoadingDialog(this);
        mLoadingDialog.show();
    }

    public void showLoading(String text) {
        mLoadingDialog = new LoadingDialog(this);
        mLoadingDialog.showWithText(text);
    }

    public void hideLoading() {
        mLoadingDialog.hide();
    }

    protected abstract void init();
}
